#ifndef _ICOMBOBOARD_H_
#define _ICOMBOBOARD_H_

#include <BStyle>
#include <BButton>
#include <BScrollArea>
#include <BComboBox>
#include <BComboItem>

namespace BWE
{
	class IComboBoard : public BScrollArea
	{
	public:
		IComboBoard(BArray<BComboItemHolder>* items, BComboBox* comboBox);
		~IComboBoard();

		void freshItemRects();

		virtual BSize sizeHint() const;

	protected:
		virtual void scrolling(Orientation orientation);

	protected:
		virtual void resizeEvent(const BEvent& event);

		virtual void styleEvent(const BEvent& event);
		virtual void freshEvent(const BEvent& event);
		virtual void paintEvent(const BEvent& event);

		virtual void keyPressEvent(const BKeyEvent& keyEvent);

		virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
		virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);

		virtual void mouseClickEvent(const BMouseEvent& mouseEvent);
		virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

	public:
		BComboBox*		comboBox;
		BPoint			popupOffset;
		int				maxShowCount;

		mutable bool	dirty;
		BSize			iconSize;
		int				spacing;
		BComboItem*		hoveredItem;
		BComboItem*		pressedItem;
		BSize			maxItemSize;
		BSize			contentSize;
		BSize			hintSize;
		int				showBegin;
		int				showEnd;

		BArray<BComboItemHolder>*	items;

	};
}
#endif
